home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
UTILITY
/
TASEXAM6.ARJ
/
GAPGRAF.TAS
< prev
next >
Wrap
Text File
|
1992-02-24
|
4KB
|
107 lines
{
This script was written to find stocks which open higher than yesterday's
high, or lower than yesterdays low, then trade higher or lower all day. This
sort of "breakaway gap" is often the beginning of a larger trend.
When it finds such situations, it will graph the stock and tell the size
of the gap, the closing price and the all time high, as well as the percent
off the high today's price is. The volume graph shows today's volume, the
50-day average volume, and today's as a percentage of the average.
The volume graph also tells the average volume for the past 3 days, and
compares this 3-day average volume to the 50-day average. This effectively
shows how the short term volume trend compares to the larger trend.
The screen then displays the same data during scanning. In addition, the
script will show stocks which had a breakaway gap yesterday, or two days
ago, reguardless of whether or not they had a gap today, because it is
interesting to see if the price action follows up in the same direction.
However, only stocks which had a gap today will be listed on the screen
during processing. 30 day trading range is also shown on the graph.
Written by Tom Rategan. Prodigy ID- PMGV10A
}
{Swapping braces on the following 2 lines directs output to file or printer}
#output_file 'Gaps.lst'
{#output_file lpt1.prn}
{************************Print a Header**************************}
if first_ticker then begin
writeln
(' ********** Stocks With Breakaway Gaps TODAY *********');
writeln
(' Name Close Change Gap %OH %30Rng Vol %Vol'
);
writeln
(' ---- ----- ------ --- --- ------ --- ----'
);
end;
{***********************Find gaps********************************}
if h[-1] < l[0] then goto g_up0;
if l[-1] > h[0] then goto g_dn0;
if h[-2] < l[-1] then goto g_up1;
if l[-2] > h[-1] then goto g_dn1;
if h[-3] < l[-2] then goto g_up2;
if l[-3] > h[-2] then goto g_dn2 else return;
{*****Determine size of gap and assign value to "days ago" variable****}
:g_up0
a:= 0;
dist = l[0] - h[-1];
gosub stats;
goto listit;
:g_dn0
a:= 0;
dist = l[-1] - h[0];
gosub stats;
goto listit;
:g_up1
a:= 1;
dist = l[-1] - h[-2];
gosub stats;
goto graphit;
:g_dn1
a:= 1;
dist = l[-2] - h[-1];
gosub stats;
goto graphit;
:g_up2
a:= 2;
dist = l[-2] - h[-3];
gosub stats;
goto graphit;
:g_dn2
a:= 2;
dist = l[-3] - h[-2];
gosub stats;
goto graphit;
{*******Compute price and volume statistics******************}
:stats
hi_valqc : array;
hi30 : array;
lo30 : array;
vo_val50 : array;
qc = (quote_count - 2);
hi30 = hhv(c,30);
lo30 = llv(c,30);
hi_valqc=hhv(c,qc);
r30 = (1-(lo30/hi30)) * 100;
oh=100-((c/hi_valqc)*100)
vo_val50 = mov(v,50,'s');
vo_val3 = ((v[0]+v[-1]+v[-2])/3);
v_v50 = ((v[0]/vo_val50[0])*100);
v3_v50 = ((vo_val3/vo_val50[0])*100);
chg = c[0] - c[-1];
return;
{*******List those stocks with a gap TODAY to screen or for printing***}
:listit
writeln(fullname,' ',c[0],' ',chg,' ',dist,' ',int(oh),'% ',int(r30),
'% ',v,' ',int(v_v50),'%');
{******Graph all stocks with a gap within past 3 days**************}
:graphit
opengraph(2);
sizegraph(4,2);
graph(1,''+format(c[0],'$%5.2f')+' is '+format(oh,'%5.2f%')
+' off '+format(hi_valqc[0],'$%5.2f')+' high. Gap= '
+format(dist,'$%4.2f')+' '+format(a,'%1.f')+' days ago. 30 day range= '
+format(r30,'%5.2f%'));
graph(v,'Today='+format(v[0],'%5.f')+' 50MA='+format(vo_val50[0],'%5.f')
+' %Today='+format(v_v50,'%4.f%')+' 3MA='+format(vo_val3,'%5.f')
+','+format(v3_v50,'%4.f%')+' of',vo_val50,'50MA');
closegraph();
return;